<template>
  <div class="content">
    <el-table
      :data="tableData"
      border
      style="width: 100%"
      height="565px"
      v-if="!isCheck"
    >
      <!-- 表格数据渲染 -->
      <el-table-column
        v-for="item in linklist"
        :key="item.id"
        :label="item.name"
        width="1050"
      >
        <template slot-scope="scope">
          <router-link
            :to="{ path: item.url, query: { info: scope.row } }"
            v-if="item.isRouter"
            >{{ scope.row[titleList[item.id]] }}
          </router-link>
          <template v-else>
            {{ scope.row[titleList[item.id]] }}
          </template>
        </template>
      </el-table-column>
      <!-- 按钮组件 -->
      <el-table-column label="管理" width="200">
        <template slot-scope="scope">
          <BtnList :btnList="btnList" :rowObj="scope.row" />
        </template>
      </el-table-column>
    </el-table>

    <el-table
      ref="multipleTable"
      :data="tableData"
      tooltip-effect="dark"
      style="width: 100%"
      height="565px"
      v-else
    >
      <el-table-column type="selection" width="55"> </el-table-column>
      <el-table-column
        v-for="item in linklist"
        :key="item.id"
        :label="item.name"
        width="150"
      >
        <template slot-scope="scope">
          <router-link
            :to="{ path: item.url, query: { info: scope.row } }"
            v-if="item.isRouter"
            >{{ scope.row[titleList[item.id]] }}
          </router-link>
          <template v-else>
            {{ scope.row[titleList[item.id]] }}
          </template>
        </template>
      </el-table-column>
      <el-table-column label="管理" width="200">
        <template slot-scope="scope">
          <BtnList
            :btnList="btnList"
            :rowObj="scope.row.documentId"
          />
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import BtnList from "../../components/TableBtn.vue";
export default {
  name: "List",
  data() {
    return {
      multipleSelection: [],
    };
  },
  components: {
    BtnList,
  },

  props: {
    // 表格模拟数据
    tableData: Array,
    // 按钮
    btnList: Array,
    // 表格模拟数据属性名
    titleList: Array,
    // 跳转路由
    linklist: Array,
    isCheck: Boolean,
   
  },
  methods: {
    handleSelectionChange(val) {
      console.log(val);
      this.multipleSelection = val;
    },

  },
};
</script>

<style lang="scss" scoped>
</style>